package bb.lanxing.model.database;

import android.os.Parcel;
import android.os.Parcelable;
import com.alibaba.fastjson.annotation.JSONField;
import com.baidu.platform.comapi.map.MapBundleKey;
import com.garmin.fit.MonitoringReader;
//import com.orm.SugarRecord;
//import com.orm.dsl.Table;

import org.litepal.crud.LitePalSupport;

import bb.lanxing.util.map.SlopeUtils;


public class RouteSlope extends LitePalTableBase implements Parcelable {
    public static final Parcelable.Creator<RouteSlope> CREATOR = new Parcelable.Creator<RouteSlope>() {

        public RouteSlope createFromParcel(Parcel parcel) {
            return new RouteSlope(parcel);
        }

        public RouteSlope[] newArray(int i) {
            return new RouteSlope[i];
        }
    };
    @JSONField(name = "avggrade")
    private float avgGrade;
    @JSONField(name = "category")
    private int category;
    @JSONField(name = MonitoringReader.DISTANCE_STRING)
    private float distance;
    @JSONField(name = "distance3d")
    private float distance3D;
    @JSONField(name = "elevationgain")
    private float elevationGain;
    @JSONField(name = "endaltitude")
    private float endAltitude;
    @JSONField(name = "enddis")
    private float endDist;
    @JSONField(name = "endindex")
    private int endIndex;
    @JSONField(deserialize = false, serialize = false)
    private long estimatedTime;
    @JSONField(name = "maxgrade")
    private float maxGrade;
    @JSONField(name = MapBundleKey.MapObjKey.OBJ_SL_INDEX)
    private int num;
    @JSONField(deserialize = false, serialize = false)
    private long routeId;
    @JSONField(name = "sample_end_index")
    private int sampleEndIndex;
    @JSONField(name = "sample_start_index")
    private int sampleStartIndex;
    @JSONField(name = "sporttype")
    private int sportType;
    @JSONField(name = "startaltitude")
    private float startAltitude;
    @JSONField(name = "startdis")
    private float startDist;
    @JSONField(name = "startindex")
    private int startIndex;

    @Override
    public int describeContents() {
        return 0;
    }

    public long getRouteId() {
        return this.routeId;
    }

    public void setRouteId(long j) {
        this.routeId = j;
    }

    public String getLevel() {
        int i = this.category;
        return i >= 80000 ? SlopeUtils.SLOPE_HC_TYPE : i >= 64000 ? "1" : i >= 32000 ? "2" : i >= 16000 ? "3" : i >= 8000 ? "4" : "Na";
    }

    public int getNum() {
        return this.num;
    }

    public void setNum(int i) {
        this.num = i;
    }

    public int getSportType() {
        return this.sportType;
    }

    public void setSportType(int i) {
        this.sportType = i;
    }

    public int getCategory() {
        return this.category;
    }

    public void setCategory(int i) {
        this.category = i;
    }

    public float getMaxGrade() {
        return this.maxGrade;
    }

    public void setMaxGrade(float f) {
        this.maxGrade = f;
    }

    public float getAvgGrade() {
        return this.avgGrade;
    }

    public void setAvgGrade(float f) {
        this.avgGrade = f;
    }

    public float getDistance() {
        return this.distance;
    }

    public void setDistance(float f) {
        this.distance = f;
    }

    public float getDistance3D() {
        return this.distance3D;
    }

    public void setDistance3D(float f) {
        this.distance3D = f;
    }

    public float getElevationGain() {
        return this.elevationGain;
    }

    public void setElevationGain(float f) {
        this.elevationGain = f;
    }

    public int getStartIndex() {
        return this.startIndex;
    }

    public void setStartIndex(int i) {
        this.startIndex = i;
    }

    public int getEndIndex() {
        return this.endIndex;
    }

    public void setEndIndex(int i) {
        this.endIndex = i;
    }

    public int getSampleStartIndex() {
        return this.sampleStartIndex;
    }

    public void setSampleStartIndex(int i) {
        this.sampleStartIndex = i;
    }

    public int getSampleEndIndex() {
        return this.sampleEndIndex;
    }

    public void setSampleEndIndex(int i) {
        this.sampleEndIndex = i;
    }

    public float getStartDist() {
        return this.startDist;
    }

    public void setStartDist(float f) {
        this.startDist = f;
    }

    public float getEndDist() {
        return this.endDist;
    }

    public void setEndDist(float f) {
        this.endDist = f;
    }

    public float getStartAltitude() {
        return this.startAltitude;
    }

    public void setStartAltitude(float f) {
        this.startAltitude = f;
    }

    public float getEndAltitude() {
        return this.endAltitude;
    }

    public void setEndAltitude(float f) {
        this.endAltitude = f;
    }

    public long getEstimatedTime() {
        return this.estimatedTime;
    }

    public void setEstimatedTime(long j) {
        this.estimatedTime = j;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeLong(this.routeId);
        parcel.writeInt(this.num);
        parcel.writeInt(this.sportType);
        parcel.writeInt(this.category);
        parcel.writeFloat(this.maxGrade);
        parcel.writeFloat(this.avgGrade);
        parcel.writeFloat(this.distance);
        parcel.writeFloat(this.distance3D);
        parcel.writeFloat(this.elevationGain);
        parcel.writeInt(this.startIndex);
        parcel.writeInt(this.endIndex);
        parcel.writeInt(this.sampleStartIndex);
        parcel.writeInt(this.sampleEndIndex);
        parcel.writeFloat(this.startDist);
        parcel.writeFloat(this.endDist);
        parcel.writeFloat(this.startAltitude);
        parcel.writeFloat(this.endAltitude);
        parcel.writeLong(this.estimatedTime);
    }

    public RouteSlope() {
    }

    protected RouteSlope(Parcel parcel) {
        this.routeId = parcel.readLong();
        this.num = parcel.readInt();
        this.sportType = parcel.readInt();
        this.category = parcel.readInt();
        this.maxGrade = parcel.readFloat();
        this.avgGrade = parcel.readFloat();
        this.distance = parcel.readFloat();
        this.distance3D = parcel.readFloat();
        this.elevationGain = parcel.readFloat();
        this.startIndex = parcel.readInt();
        this.endIndex = parcel.readInt();
        this.sampleStartIndex = parcel.readInt();
        this.sampleEndIndex = parcel.readInt();
        this.startDist = parcel.readFloat();
        this.endDist = parcel.readFloat();
        this.startAltitude = parcel.readFloat();
        this.endAltitude = parcel.readFloat();
        this.estimatedTime = parcel.readLong();
    }
}
